Skip to content

perf(test): isolate runtime test support and consolidate CLI contracts - #2008

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/cli-test-build-isolation-pr14
Aug 3, 2026
Merged

perf(test): isolate runtime test support and consolidate CLI contracts#2008
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/cli-test-build-isolation-pr14

Conversation

@limityan

@limityan limityan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Keep bitfun-runtime-services::test_support out of ordinary library builds and enable it only for owner tests or explicit dev-dependency consumers.
  • Preserve the runtime-services owner contract suite in the default crate test target, so cargo test -p bitfun-runtime-services still runs all 11 tests.
  • Consolidate four related CLI command/product contract targets into one cli_command_contracts target while keeping ACP and terminal process contracts independent.
  • Extend the existing core-boundary checker to lock the three-target CLI topology, grouped leaf ownership, and dev-only test-support feature edges.

No GitHub Actions workflow was added or changed.

Architecture

  • Runtime fakes remain owned by Execution and do not enter normal/build dependency graphs.
  • Assembly and Agent Runtime consume the fake only through dev-dependencies; SDK smoke tests keep their narrower public-SDK fake.
  • CLI target consolidation changes test assembly only. Product behavior, command ownership, runtime wiring, and production features are unchanged.
  • The topology guard intentionally checks Cargo targets, top-level roots, and grouped leaf ownership only; a proposed source-level Rust macro parser was removed during review as disproportionate governance.

Build impact

Measurements used the same Windows worktree and dependency cache, warmed each feature fingerprint, cleaned only bitfun-cli, and forced -j 1 because other workspace builds were active on the host.

Scenario Before After Change
Full CLI test --no-run 141.002 s 139.474 s -1.1%
Related artifact files 18 9 -50.0%
Related artifact bytes 44,293,955 30,466,416 -31.2%
Focused plugin contract recompile 1.507 s 1.664 s +0.157 s

The wall-time result is intentionally reported as near-neutral rather than a large speedup; the material win is reduced duplicate test artifacts without losing focused test filters.

Validation

  • pnpm run fmt:rs
  • pnpm run check:core-boundaries:test — 44/44
  • pnpm run check:core-boundaries
  • cargo check --workspace --exclude bitfun-desktop --locked
  • cargo test -p bitfun-runtime-services --locked — 11/11
  • cargo test -p bitfun-product-capabilities --locked — 30/30
  • cargo test -p bitfun-cli --locked --test acp_stdio_cli --test cli_command_contracts --test terminal_process_contracts — 41/41
  • cargo test -p bitfun-agent-runtime --tests --locked
  • cargo test -p bitfun-core --features product-full --lib --locked — 1814 passed, 1 ignored

A full cargo check --workspace --locked reached the desktop build script and stopped because this isolated worktree does not contain generated src/mobile-web/dist. The same check excluding bitfun-desktop passed; no generated frontend output was created or committed.

Two independent adversarial reviewers examined the feature graph, layer direction, Cargo test discovery, path equivalence, focused-test behavior, and checker scope over multiple rounds. The final reduced design has no outstanding P1/P2 finding.

@limityan
limityan merged commit fe2351f into GCWing:main Aug 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant